package com.supermap.test;

import com.supermap.License;
import com.supermap.data.*;

public class YashanStatistic {
    public static void main(String[] args) {


        Workspace workspace = new Workspace();
        WorkspaceConnectionInfo conInfo = new WorkspaceConnectionInfo(
                "E:\\MapData\\202410\\WorkSpaceYS.smwu");
        conInfo.setType(WorkspaceType.SMWU);
        workspace.open(conInfo);


        Datasource d = workspace.getDatasources().get(0);
        DatasetVector datasetVector = (DatasetVector)d.getDatasets().get("ROA_CL_Dissolve");
        Double len = datasetVector.statistic("SmLength".toUpperCase(),StatisticMode.SUM);
        System.out.println(len);
        datasetVector.dispose();

        Datasource d2 = workspace.getDatasources().get(1);
        DatasetVector datasetVector2 = (DatasetVector)d2.getDatasets().get("ROA_CL_Dissolve");
        Double len2 = datasetVector2.statistic("SmLength".toUpperCase(),StatisticMode.SUM);
        System.out.println(len2);
        datasetVector2.dispose();


        workspace.save();
        workspace.dispose();



    }
}
